namespace EFS.EventLog.Writers
{
	public sealed class Console
	{
		// synk
		private object syncAccess = new object();

		/// Property Instance (singleton): Get
		public static Console Instance { get; private set; }

		/// <summary>
		/// Static constructor to init local instance
		/// </summary>
		static Console()
		{
			Instance = new Console();
		}

		/// <summary>
		/// Contructor
		/// </summary>
		private Console()
		{
		}

		// Log entry
		public void Write(System.String message)
		{
			lock (syncAccess)
			{
				try
				{
					// write
					System.Console.WriteLine(message);
				}
				catch (System.Exception e)
				{
					System.Diagnostics.Debug.WriteLine(e);
				}
			}
		}
	}
}